package com.sun.sentinel.controller;

import com.sun.sentinel.feign.HelloFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    @Qualifier("com.sun.sentinel.feign.HelloFeignClient")
    private HelloFeignClient helloFeignClient;

    @GetMapping(value = "/hi/{name}")
    public String hi(@PathVariable String name) {
        return helloFeignClient.sayHi(name);
    }

}